package com.xiang.mall.platform.uc.repository

import com.xiang.mall.platform.uc.entity.UserEntity
import org.springframework.data.jpa.repository.JpaRepository

/**
 * @author xiangliyou
 * @email xiangliyou1814@mail.yneusoft.com
 * @date 2019-03-07 11:55
 *
 */
interface UserRepository: JpaRepository<UserEntity, Long> {

    /**
     * 通过用户名查找用户
     */
//    fun findByUsername(username: String): UserEntity?

    /**
     * 通过手机号查找用户
     */
    fun findByMobileNo(mobileNo:String): UserEntity?

    /**
     * 通过邮箱查找用户
     */
    fun findByEmail(email:String): UserEntity?

    /**
     * 判断用户存不存在
     */
    fun existsByUsernameOrMobileNoOrEmail(username: String, mobileNo: String, email: String): Boolean

    /**
     * 通过用户名查找用户
     */
    fun findByUsername(username: String): UserEntity?
}